import React, {Component} from 'react'
import {
    Text,
    Image,
    View,
    StyleSheet,
    Button
} from 'react-native'

export default class Page2 extends Component {
    constructor(props) {
        super(props)

    }

    render() {
        const {navigation} = this.props;
        console.log("---------------->")
        return (
            <View>
                <Text style={styles.text}>
                    欢迎来到page2
                </Text>

                <Button
                    title="Go back"
                    onPress={() => {
                        navigation.goBack();
                    }}
                />

                <Button
                    title='go to page1'
                    onPress={() => {
                        navigation.navigate("Page1");
                    }}
                />
                <Button
                    title='go to page3'
                    onPress={() => {
                        navigation.navigate("Page3");
                    }}
                />


            </View>
        )
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#F5FCFF',
    },
    page1: {
        flex: 1,
        backgroundColor: 'red'
    },
    page2: {
        flex: 1,
        backgroundColor: 'blue'
    },
    image: {
        width: 22,
        height: 22
    },
    text: {
        fontSize: 20,
        color: 'black'
    }
})